package com.hexinfo.dmpro.dev.data.transfer.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@AllArgsConstructor
public enum DevDataTransferListStatusEnum {

    TODO("待处理", "TODO"),

    BUILD_FAIL("构建失败", "BUILD_FAIL"),

    RUNNING("处理中", "RUNNING"),

    SUCCESS("处理成功", "SUCCESS"),

    NOT_SUPPORTED("不支持", "NOT_SUPPORTED"),

    FAIL("处理失败", "FAIL"),

    ABOLISH("已中止", "ABOLISH")
    ;

    @Getter
    private final String name;

    @Getter
    private final String value;

    public static List<String> getValues() {
        return Arrays.stream(DevDataTransferListStatusEnum.values()).map(DevDataTransferListStatusEnum::getValue).collect(Collectors.toList());
    }

    public static DevDataTransferListStatusEnum getByValue(String value) {
        return DevDataTransferListStatusEnum.valueOf(value);
    }
}
